<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <h2>解构赋值</h2>
</body>
<script>
    //数组解构
    const arr=['vue','react','angular']
    let [one1,two,three]=arr
    // console.log(one1)
    // console.log(two)
    // console.log(three)
    //字符串解构
   const str='China'
   let [a,b,c]=str
    //对象解构
    let obj={
        name:'jack',
        age:20,
        address:'北京'
    }

    let {name:mingzi,age:nianling}=obj;

    console.log(mingzi)
    console.log(nianling)
    
</script>
</html>